﻿using System.IO;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.IO.IsolatedStorage;
using Zeus.Classes.Documents;

namespace Zeus.Classes.Engines.Image_Engine
{
    public partial class EditorImage : UserControl
    {
        public EditorImage()
        {
            InitializeComponent();
        }
        public EditorImage(Document imageDoc)
        {
            InitializeComponent();
            BitmapImage bitmapImage = new BitmapImage();

            IsolatedStorageFile isolated = IsolatedStorageFile.GetUserStoreForApplication();
            IsolatedStorageFileStream isolatedStorageFileStream =isolated.OpenFile(imageDoc.FilePath, FileMode.Open);
            bitmapImage.SetSource(isolatedStorageFileStream);
            isolatedStorageFileStream.Close();

            Imagecontrol.Source = bitmapImage;
        }
    }
}
